﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="HouseDetail.aspx.cs" Inherits="Interface.Houses.HouseDetail" %>
<%@ Register Src="~/UserControls/GoogleMap.ascx" TagName="GoogleMap" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div class="le-co-menu">
        <div class="le-co-ti-color">
            <div class="le-co-hi-title"> THÔNG TIN NHÀ TRỌ</div>
        </div>
        <div class="dlQ">            
            <asp:FormView ID="fview" runat="server" BackColor="White" BorderColor="#CCCCCC" 
                        BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" 
                        GridLines="Horizontal" Width="451px" EnableViewState="False" 
                        onpageindexchanging="fview_PageIndexChanging" >
                <ItemTemplate>
                    <table style="width: 433px">
                        <tr>                
                            <td colspan="2" align="center"><asp:Label runat="server" ID="lblName" Text='<%# bind("ChuNha") %>' ForeColor="DarkRed" Font-Size="Medium" Font-Bold="true"></asp:Label><br /></td>
                        </tr>
                            <tr>                        
                                <td align="left">                    
                                    <asp:Label runat="server" ID="lbl" Text="Chủ Nhà: "></asp:Label><br />                            
                                    <asp:Label runat="server" ID="lbl2" Text="Đường: "></asp:Label><br />                                               
                                    <asp:Label runat="server" ID="lbl3" Text="Phường: "></asp:Label><br />                                      
                                    <asp:Label runat="server" ID="lbl5" Text="Quận: "></asp:Label><br />                                               
                                    <asp:Label runat="server" ID="lbl4" Text="Thành Phố: "></asp:Label><br />                                                                           
                                    <asp:Label runat="server" ID="lbl6" Text="Loại Nhà Trọ: "></asp:Label><br />
                                    <asp:Label runat="server" ID="Label9" Text="Số Phòng: "></asp:Label><br />
                                    <asp:Label runat="server" ID="Label11" Text="Số Phòng Còn Trống: "></asp:Label><br />
                                    <asp:Label runat="server" ID="Label12" Text="Hình Ảnh: "></asp:Label><br />
                                    <asp:Label runat="server" ID="Label14" Text="Miêu Tả: "></asp:Label><br />                                             
                                    <%--<asp:Label runat="server" ID="lbl7" Text="Đánh Giá: "></asp:Label><br /> --%>                                                
                                    <asp:Label runat="server" ID="lbl8" Text="Điện Thoại Liên Lạc: "></asp:Label><br />
                                    <asp:Label runat="server" ID="lbl9" Text="Bản đồ: "></asp:Label>                                                                    
                                                                             
                                </td> 
                                <td align="left">
                                    <asp:Label runat="server" ID="_ChuNha" Text='<%# bind("ChuNha") %>'></asp:Label><br />
                                    <asp:Label runat="server" ID="_Duong" Text='<%# bind("Duong") %>'></asp:Label><br /> 
                                    <asp:Label runat="server" ID="_Phoung" Text='<%# bind("Phuong") %>'></asp:Label><br />
                                    <asp:Label runat="server" ID="_Quan" Text='<%# bind("Quan") %>'></asp:Label><br /> 
                                    <asp:Label runat="server" ID="_ThanhPho" Text='<%# bind("ThanhPho") %>'></asp:Label><br />
                                    <asp:Label runat="server" ID="_LoaiNhaTro" Text='<%# bind("LoaiNhaTro") %>'></asp:Label><br />
                                    <asp:Label runat="server" ID="Label10" Text='<%# bind("SoPhong") %>'></asp:Label><br />
                                    <asp:Label runat="server" ID="Label13" Text='<%# bind("Sophongcontrong") %>'></asp:Label><br /> 
                                    <asp:Image runat="server" ID="ImgHouse" ImageUrl='<%# bind("Hinhanh") %>'/><br />
                                    <asp:Label runat="server" ID="Label15" Text='<%# bind("Mieuta") %>'></asp:Label><br /> 
                                    <%--<asp:Label runat="server" ID="_DanhGia" Text='<%# bind("DanhGia") %>'></asp:Label><br />--%>   
                                    <asp:Label runat="server" ID="_DienThoai" Text='<%# bind("LienHe") %>'></asp:Label><br />
                                    <uc1:GoogleMap runat="server" ID="GoogleMap"/>                            
                                </td>
                                                           
                        </tr>
                    </table>
                </ItemTemplate>
                <EditItemTemplate>
                        <table>
                            <tr>
                                <td align="left">
                                    <asp:Label runat="server" ID="lbl6" Text="Chủ Nhà:"></asp:Label></td>
                                <td align="left">                            
                                    <asp:TextBox runat="server" ID="txtEditName" Text='<%# bind("ChuNha") %>'></asp:TextBox>
                                </td>
                            </tr>
                            <tr>
                                <td align ="left">
                                    <asp:Label runat="server" ID="lbThanhPho" Text="Thành Phố: "></asp:Label></td>
                                </td>
                                <td align="left">
                                    <asp:DropDownList runat="server" ID="ddlEditCity" DataSourceID="CityDs" DataTextField="Name" AutoPostBack="true" OnSelectedIndexChanged="ddlEditCity_SelectedIndexChanged"
                                    DataValueField="Name" SelectedValue='<%# Eval("ThanhPho")%>'>
                                    </asp:DropDownList><asp:SqlDataSource ID="CityDs" runat="server" ConnectionString="<%$ ConnectionStrings:QLNTConStr %>"
                                    SelectCommand="SELECT [Name] FROM [City]"></asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label runat="server" ID="lbQuan" Text="Quận:"></asp:Label></td>
                                <td align="left">                            
                                   <asp:DropDownList runat="server" ID="ddlEditDis" DataSourceID="DisDs" DataTextField="Name"
                                    DataValueField="Name" SelectedValue='<%# Eval("Quan")%>' >
                                    </asp:DropDownList><asp:SqlDataSource ID="DisDs" runat="server" ConnectionString="<%$ ConnectionStrings:QLNTConStr %>"
                                    SelectCommand="SELECT [Name] FROM [District]"></asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td align="left">
                                    <asp:Label runat="server" ID="lblLoaiNhaTro" Text="Loại Nhà Trọ:"></asp:Label></td>
                                <td align="left">                            
                                   <asp:DropDownList runat="server" ID="ddlEditLoaiNhaTro" DataSourceID="CateDs" DataTextField="Name"
                                    DataValueField="Name" SelectedValue='<%# Eval("LoaiNhaTro")%>' >
                                    </asp:DropDownList><asp:SqlDataSource ID="CateDs" runat="server" ConnectionString="<%$ ConnectionStrings:QLNTConStr %>"
                                    SelectCommand="SELECT [Name] FROM [Category]"></asp:SqlDataSource>
                                </td>
                            </tr>
                            <tr>
                                <td align ="left">
                                    <asp:Label runat="server" ID="LbDuong" Text="Đường: "></asp:Label></td>
                                </td>
                                <td align="left">
                                    <asp:TextBox runat="server" ID="txtDuong" Text='<%# bind("Duong") %>'></asp:TextBox>
                                </td>
                            </tr>
                    
                            <tr>
                                <td align ="left">
                                    <asp:Label runat="server" ID="lbPhuong" Text="Phường: "></asp:Label></td>
                                </td>
                                <td align="left">
                                    <asp:TextBox runat="server" ID="txtPhuong" Text='<%# bind("Phuong") %>'></asp:TextBox>
                                </td>
                            </tr>                                                                     
                    
                            <tr>
                                <td align ="left">
                                    <asp:Label runat="server" ID="lbDienThoai" Text="Điện thoại: "></asp:Label></td>
                                </td>
                                <td align="left">
                                    <asp:TextBox runat="server" ID="txtDienThoai" Text='<%# bind("LienHe") %>'></asp:TextBox>
                                </td>
                            </tr>  
                            <tr>
                                <td align ="left">
                                    <asp:Label runat="server" ID="lbSoPhong" Text="Số Phòng: "></asp:Label></td>
                                </td>
                                <td align="left">
                                    <asp:TextBox runat="server" ID="txtSoPhong" Text='<%# bind("SoPhong") %>'></asp:TextBox>
                                </td>
                            </tr>   
                            <tr>
                                <td align ="left">
                                    <asp:Label runat="server" ID="lbPhongCon" Text="Số Phòng Còn Trống: "></asp:Label></td>
                                </td>
                                <td align="left">
                                    <asp:TextBox runat="server" ID="txtPhongCon" Text='<%# bind("Sophongcontrong") %>'></asp:TextBox>
                                </td>
                            </tr> 
                            <tr>
                    <td class="style3">
                        Lat</td>
  
                    <td class="style2">
                        <asp:TextBox ID="txtLat" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="style3">
                        Long</td>
  
                    <td class="style2">
                        <asp:TextBox ID="txtLong" runat="server"></asp:TextBox>
                    </td>
                </tr>
                    
                            <tr>
                            <td style="width: 110px; height: 25px;">
                                </td>
                            <td style="text-align: left; height: 25px;" colspan="2">
                                <asp:Button ID="btnUpdate" runat="server" Font-Names="Verdana" Font-Size="8pt" OnClick="btnUpdate_Click"
                                    Text="Cập nhật" Width="70px" />                        
                                <asp:Label ID="lblUpdate" runat="server" Font-Names="Verdana" Font-Size="8pt" ForeColor="#000066" Width="164px"></asp:Label></td>
                        </tr>                         
                        </table>
                 </EditItemTemplate>
            </asp:FormView>
            <table style="width: 457px">
                <tr>
                    <td style="text-align: left; width: 443px;" colspan="3">
                        <asp:Button ID="btnEdit" runat="server" OnClick="btnEdit_Click" Text="Edit"/>&nbsp;<asp:Button 
                            ID="btnChiTiet" runat="server" Text="Chi Tiết" 
                            onclick="btnChiTiet_Click" />
        &nbsp; <asp:Button
                                ID="btnBack" runat="server" Text="Back" onclick="btnBack_Click"/>
                        &nbsp;<br />
                        <asp:Label ID="lblError" runat="server"></asp:Label>
                    </td>
                </tr>
            </table>
        </div>
    
</div>
</asp:Content>

